package com.yanqu.road.server.cmd.activity.peakseacraft;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.PeakSeacraftProto;
import com.yanqu.road.pb.activity.SeacraftSouthSeaProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.peakseacraft.PeakSeacraftMgr;
import com.yanqu.road.server.manager.activity.seacraftsouthsea.SeacraftSouthSeaMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

import java.util.List;

/**
 * @Description
 * @Author cwq
 * @Data 2022/1/20 17:21
 */
@Cmd(code = CrossProtocol.C_PEAK_SEACRAFT_SYN_PATRONS_INFO, desc = "海上争霸 南海丝路 同步有变化的门客信息")
public class CrossPeakSeacraftSynPatronsInfoCmd extends CrossUnionCommand {

    int activityId;
    List<PeakSeacraftProto.PeakSeacraftSynUserPatronsInfo> userPatronsInfoList;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        PeakSeacraftProto.PeakSeacraftSynUserInfoGameToCrossMsg reqMsg = PeakSeacraftProto.PeakSeacraftSynUserInfoGameToCrossMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        userPatronsInfoList = reqMsg.getUserPatronsListList();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        PeakSeacraftMgr.synUserInfo(activityId, userPatronsInfoList, groupId);

    }

    @Override
    public void sendData() {

    }
}
